<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\Route;

// 文章
Route::post('api/:version/article/create', 'api/:version.Article/createArticle');
Route::delete('api/:version/article/delete/:id', 'api/:version.Article/deleteArticle');
Route::put('api/:version/article/update', 'api/:version.Article/updateArticle');
Route::get('api/:version/article/list/:page/:size', 'api/:version.Article/listArticle');
Route::get('api/:version/article/read/:id', 'api/:version.Article/readArticle');

// 管理员
Route::post('api/:version/admin/create', 'api/:version.Admin/createAdmin');
Route::post('api/:version/admin/login', 'api/:version.Admin/login');
Route::delete('api/:version/admin/delete/:id', 'api/:version.Admin/deleteAdmin');
Route::put('api/:version/admin/update', 'api/:version.Admin/updateAdmin');
Route::get('api/:version/admin/logout', 'api/:version.Admin/logout');
Route::get('api/:version/admin/all', 'api/:version.Admin/allAdmin');
Route::get('api/:version/admin/info', 'api/:version.Admin/getAdminInfo');

// 文章分类
Route::get('api/:version/category/all', 'api/:version.Category/allCategory');
Route::post('api/:version/category/create', 'api/:version.Category/createCategory');
Route::put('api/:version/category/update', 'api/:version.Category/updateCategory');
Route::delete('api/:version/category/delete/:id', 'api/:version.Category/deleteCategory');

// 评论
Route::get('api/:version/comment/by_article/:page/:size', 'api/:version.Comment/readCommentByArticleID');
Route::post('api/:version/comment/create', 'api/:version.Comment/createComment');
Route::put('api/:version/comment/update', 'api/:version.Comment/updateComment');
Route::delete('api/:version/comment/delete/:id', 'api/:version.Comment/deleteComment');